<template>
  <view class="note-detail">
    <view class="header">
      <uni-icons type="left" size="24" @click="goBack()"/>
      <text class="title">新增笔记</text>
    </view>
    
    <view class="content">
      <text class="title">{{note.title}}</text>
      <text class="content-text">{{note.content}}</text>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      note: {
        title: '新笔记',
        content: ''
      }
    }
  },
  onBackPress() {
    uni.switchTab({
        url: '/pages/home/index'
    })
  },
  methods: {
    goBack() {
      uni.navigateBack()
    }
  },
}
</script>

<style scoped>
.note-detail {
  padding: 24px;
}

.header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.header .title {
  font-size: 20px;
  font-weight: bold;
  margin-right: 12px;
  flex-grow: 1;
  text-align: center;
}

.header .uni-icons {
  margin-left: auto;
}

.content {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
}

.content .title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 16px;
  display: block;
}

.content-text {
  font-size: 16px;
  line-height: 1.6;
  color: #666;
}
</style>
